<template>
  <div class="activity-item" @click="$router.push('/businesses/' + id)">
    <div class="pic">
      <img :src="feed_url" alt="" />
    </div>
    <div class="desc">
      <div class="title">{{ title }}</div>
      <div class="time-box">
        <span class="address">{{ address }}</span>
      </div>
      <div class="side-box">
        <div class="likes">
          <span class="icon">
            <img src="@/assets/goImages/_U.png" alt="" />
          </span>
          <span class="like-count">{{ likes }}</span>
        </div>
        <div class="side">
          <span class="icon">
            <img src="@/assets/goImages/K5.png" alt="" />
          </span>
          <span class="side-count">{{ pic_count || 0 }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    feed_url: String,
    title: String,
    address: String,
    likes: { type: Number, default: 0 },
    id: Number,
    pic_count: {
      type: Number,
      default: 0
    }
  }
}
</script>

<style lang="less" scoped>
.activity-item {
  display: flex;
  margin-bottom: 10px;
  img {
    height: 100%;
    width: 100%;
  }

  .pic {
    height: 80px;
    width: 80px;
  }
  .desc {
    padding-left: 10px;
    flex: 1;

    .title {
      color: #333;
      font-size: 16px;
      font-weight: 700;
      max-width: 200px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .time-box {
      display: flex;
      align-items: center;
      color: #aaa;
      font-size: 12px;
      padding: 5px 0;

      .address {
        padding: 5px 0;
        max-width: 120px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
    }

    .side-box {
      display: flex;
      align-items: center;
      padding: 5px 0;
      margin-top: 5px;
      font-size: 14px;
      color: #cacaca;

      .likes,
      .side {
        display: flex;
        align-items: center;
        margin-right: 10px;

        .icon {
          height: 14px;
          width: 14px;
        }
      }
    }
  }
}
</style>
